<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="../style/main.css" type="text/css" rel="stylesheet">
        <link href="../style/store.css" type="text/css" rel="stylesheet">
        <script type="text/javascript" src="../script/jquery-1.8.2.js"></script>
</head>

<body>

 <header>
        <?php
        session_start();
        mysql_connect("localhost:3306", "root", "16886611");
        mysql_select_db("digitalsales");
        if(isset($_GET["action"])){
            if($_GET["action"]=="logout"){
               $_SESSION["username"]=NULL;
            }
        }
        if(!isset($_SESSION["username"])||$_SESSION["username"]==NULL){
        echo '<ul>
                <li id="login">
                  <p>Log in</p>
                </li>
                 <li>
                    <p><a href="../register/register.php">Register</a></p>
                  </li>
                </ul>';
        }else{
            echo '<ul>
                <li id="logout">
                  <p><a href="../index.php?action=logout">Log out</a></p>
                </li>
                 <li>
                    <p><a href="../myAccount/myAccount.php">My Account</a></p>
                  </li>
                  <li>
                    <p><a href="../myAccount/order.php">My Orders</a></p>
                  </li>
                  <li>
                    <p>Welcome back,'.$_SESSION["username"].'!</p>
                  </li>
                </ul>';
        }
        
        ?>
        </header>
    
    <div id="store_name" class="MainPanel">

	<?php	
	$query=mysql_query("SELECT NAME FROM stores WHERE STOREID = ".$_GET['storeid']."");
	$query_row=mysql_fetch_array($query);
	echo($query_row[0]);
	?>
<br />
</div>
    
    <div id="store_description" class="MainPanel">

<table>

<tr>
<th>Name</th>
<td>
	<?php	
	$query=mysql_query("SELECT NAME FROM stores
	WHERE STOREID = ".$_GET['storeid']."");
	$query_row=mysql_fetch_array($query);
	echo($query_row[0]);
	?>
</td>
</tr>

<tr>
<th>Manager</th>
<td>
	<?php	
	$query=mysql_query("SELECT MANAGER FROM stores
	WHERE STOREID = ".$_GET['storeid']."");
	$query_row=mysql_fetch_array($query);
	echo($query_row[0]);
	?>
</td>
</tr>

<tr>
<th>Street</th>
<td>
    <?php	
	$query=mysql_query("SELECT STREET FROM stores
	WHERE STOREID = ".$_GET['storeid']."");
	$query_row=mysql_fetch_array($query);
	echo($query_row[0]);
	?>
</td>
</tr>

<tr>
<th>City</th>
<td>
    <?php	
	$query=mysql_query("SELECT CITY FROM stores
	WHERE STOREID = ".$_GET['storeid']."");
	$query_row=mysql_fetch_array($query);
	echo($query_row[0]);
	?>
</td>
</tr>

<tr>
<th>State</th>
<td>
    <?php	
	$query=mysql_query("SELECT STATE FROM stores
	WHERE STOREID = ".$_GET['storeid']."");
	$query_row=mysql_fetch_array($query);
	echo($query_row[0]);
	?>
</td>
</tr>

<tr>
<th>Zip</th>
<td>
    <?php	
	$query=mysql_query("SELECT ZIP FROM stores
	WHERE STOREID = ".$_GET['storeid']."");
	$query_row=mysql_fetch_array($query);
	echo($query_row[0]);
	?>
</td>
</tr>

<tr>
<th>Region</th>
<td>
    <?php	
	$query=mysql_query("SELECT REGION FROM stores
	WHERE STOREID = ".$_GET['storeid']."");
	$query_row=mysql_fetch_array($query);
	echo($query_row[0]);
	?>
</td>
</tr>

</table>
    
</div>
    
</body>

</html>